package ca.quicko.webapp.action;

import java.util.List;

import org.appfuse.service.GenericManager;
import org.appfuse.webapp.action.BaseAction;

import ca.quicko.model.Solution;

/**
 * @author <a href="mailto:eric.s.landry@gmail.com">Eric S. Landry</a>
 */
public class SolutionAction extends BaseAction {
	private static final long serialVersionUID = 2140366669014479190L;

	private GenericManager<Solution, Long> solutionManager;

	private List solutions;

	public void setSolutionManager(
			GenericManager<Solution, Long> solutionManager) {
		this.solutionManager = solutionManager;
	}

	public Solution getSolution(Long id) {
		return solutionManager.get(id);
	}

	public List getSolutions() {
		return solutions;
	}

	public String list() {
		solutions = solutionManager.getAll();
		return SUCCESS;
	}
}
